package com.cn.api.controller;

import com.alibaba.fastjson.JSON;
import com.cn.api.holder.LoginUserHolder;
import com.cn.auth.model.vo.UserDetailsVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhoujunming
 * @Description TODO
 * @date 2022/6/9 15:30
 * @email zhoujunming@bluemoon.com.cn
 */
@RestController
@RequestMapping("/order")
@Slf4j
public class TestController {
    @Autowired
    private LoginUserHolder loginUserHolder;

    @PostMapping("/add")
    public String add(){
        UserDetailsVO user= loginUserHolder.getCurrentUser();
        log.info(JSON.toJSONString(user));
        return "add";
    }

    @PostMapping("/update")
    public String update(){
        return "update";
    }

    @PostMapping("/delete")
    public String delete(){
        return "delete";
    }

    @PostMapping("/query")
    public String query(){
        return "query";
    }
}
